package jbl.action;
import jbl.pageModel.IconCls;
import jbl.service.IconClsServiceI;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;
/**
 * 
 * @author jblcxg
 * 
 * 图标管理类  该类新添加图标信息 需要在jbldangl\src\main\webapp\js\icons 下icon文件夹中添加图标图片信息和在icon.css文件中添加对应的css信息
 *
 */
@Namespace("/")
@Action(value="iconClsAction")
public class IconClsAction extends BaseAction implements ModelDriven<IconCls>{
	private IconCls iconCls=new IconCls();
	
	private IconClsServiceI iconClsService;
	
	@Autowired
	public void setIconClsService(IconClsServiceI iconClsService) {
		this.iconClsService = iconClsService;
	}

	@Override
	public IconCls getModel() {
		return iconCls;
	}
	/**
	 * 获取图标dataGrid
	 */
	public void dataGrid(){
		writeJson(iconClsService.dataGrid(iconCls));
	}
	/**
	 * 添加图标信息
	 */
	public void add(){
		writeJson(iconClsService.add(iconCls));
	}
	/**
	 * 修改图标信息
	 */
	public void edit(){
		writeJson(iconClsService.edit(iconCls));
	}
	/**
	 * 删除图标信息
	 */
	public void delete(){
		writeJson(iconClsService.delete(iconCls.getIds()));
	}
	/**
	 * 获取图标信息list  下拉列表值
	 */
	public void comboboxInfo(){
		writeJson(iconClsService.comboboxInfo());
	}
}
